package online.flowerinsnow.minecraft.bukkit.manhunt.event;

import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;

public class PlayerEatSkullEvent extends Event implements Cancellable {
    public final Player player;
    public final ItemStack item;
    private final boolean goldenHead;


    public static final HandlerList HANDLER_LIST = new HandlerList();

    public PlayerEatSkullEvent(Player player, ItemStack item, boolean goldenHead) {
        this.player = player;
        this.item = item;
        this.goldenHead = goldenHead;
    }

    public boolean isGoldenHead() {
        return goldenHead;
    }

    @Override
    public @NotNull HandlerList getHandlers() {
        return PlayerEatSkullEvent.HANDLER_LIST;
    }

    public static HandlerList getHandlerList() {
        return PlayerEatSkullEvent.HANDLER_LIST;
    }

    public boolean cancelled;

    @Override
    public boolean isCancelled() {
        return this.cancelled;
    }

    @Override
    public void setCancelled(boolean cancel) {
        this.cancelled = cancel;
    }
}
